package com.hjw.pojo;

import java.time.LocalDate;

/**
 * DVD实体类，定义了DVD名称、DVD名称、借出时间、借出次数、归还时间、租金/天
 * @author hjwStrart
 * @create 2022-01-14 9:55
 */
public class DVD {
    private String name;       //DVD名称
    private Integer status = 0; //DVD名称 0未借出 1已借出
    private LocalDate loanTime;//借出时间
    private Long loanCount;//借出次数
    private LocalDate returnTime;//归还时间
    private Double rent;  // 租金/天

    public DVD() {
    }

    public DVD(String name,Integer status, LocalDate loanTime, Long loanCount, LocalDate returnTime, Double rent) {
        this.name = name;
        this.status = status;
        this.loanTime = loanTime;
        this.loanCount = loanCount;
        this.returnTime = returnTime;
        this.rent = rent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public LocalDate getLoanTime() {
        return loanTime;
    }

    public void setLoanTime(LocalDate loanTime) {
        this.loanTime = loanTime;
    }

    public Long getLoanCount() {
        return loanCount;
    }

    public void setLoanCount(Long loanCount) {
        this.loanCount = loanCount;
    }

    public LocalDate getReturnTime() {
        return returnTime;
    }

    public void setReturnTime(LocalDate returnTime) {
        this.returnTime = returnTime;
    }

    public Double getRent() {
        return rent;
    }

    public void setRent(Double rent) {
        this.rent = rent;
    }

    @Override
    public String toString() {

        return "DVD{" +
                "名称=" + name +
                "," + (loanTime == null ? "状态：未借出" : " 借出时间=" + loanTime )+
                ", 借出次数=" + loanCount +
                (loanTime == null ? "" : ("," + (returnTime == null ? "状态：未归还" : (" 归还时间=" + returnTime) )))+
                ", 租金/天=" + rent + "元" +
                '}';
    }

}

